<template>
  <Spin :spinning="loading" tip="Loading...">
    <div>
      <!-- table -->
      <!-- 旧件回运 - 编辑 -->
      <BreakSpace label="通知单信息" :containerStyle="{ marginBottom: '10px' }" />
      <FormPanel ref="formPanel1" :list="formList" :cols="3" :formType="'add'" labelWidth="100" :isSubmitBtn="false" @formChange="formChangeHandle1" />
      <div style="margin-bottom: 1rem;"></div>
      <BreakSpace label="上报信息" :containerStyle="{ marginBottom: '10px' }" />
      <FormPanel ref="formPanel2" :list="formList2" :cols="3" :formType="'add'" labelWidth="100" :isSubmitBtn="false" @formChange="formChangeHandle2" />
      <div style="margin-bottom: 2rem;"></div>
      <BreakSpace label="保修旧件列表" :containerStyle="{ marginBottom: '10px' }" />
      <FilterTable ref="table1" :columns="columns" :params="fetchParams" :dataSource="dataList" :datakey="'items'" :onColumnsChange="columns => (this.columns = columns)" :onRowSelectChange="selectChange" selectionType="single" height="auto" :isPagination=false :isSelectColumn=false>
        <template slot="controls" slot-scope="props">
          <el-button size="small" type="text" style="font-size: 14px; color: #bb2801; font-weight: bold">
            <span v-text="`请先选择旧件仓库，切换旧件仓库会清空旧件列表`"></span>
          </el-button>
          <multiuse-button size="small" type="primary" icon="el-icon-plus" :disabled="jfDisableButton" @click="maintainItemSelectTurnOn()">新增</multiuse-button>
        </template>
      </FilterTable>
      <div style="margin-bottom: 1rem;"></div>
      <BreakSpace label="操作记录" :containerStyle="{ marginBottom: '10px' }" />
      <FilterTable ref="table2" :columns="columns2" :params="fetchParams" :dataSource="dataList2" :datakey="'items'" :onColumnsChange="columns => (this.columns2 = columns2)" :onRowSelectChange="selectChange" selectionType="single" height="auto" :isPagination=false :isSelectColumn=false></FilterTable>
      <div style="margin-bottom: 1rem;"></div>
      <div :style="{
        position: 'fixed',
        left: 0,
        bottom: 0,
        right: 0,
        zIndex: 9,
        borderTop: '1px solid #e9e9e9',
        padding: '10px 20px',
        background: '#fff',
        textAlign: 'right'
      }">
        <!--      <multiuse-button type="primary" @click="">打 印</multiuse-button>-->
        <span v-if="appId == 'beijing'" style="color: #bb2801;font-weight: bold;">回运上报日期为 {{ returnTimeStart }} ~ {{ returnTimeEnd }}</span>
        <multiuse-button type="primary" :click="printBox.bind()">打印装箱单</multiuse-button>
        <multiuse-button type="primary" :click="saveDialog.bind()">保 存</multiuse-button>
        <multiuse-button type="primary" :click="saveDialog2.bind()" :disabled="!showReport">上 报</multiuse-button>
        <multiuse-button @click="closeDialog">关 闭</multiuse-button>
      </div>
      <div style="margin-bottom: 1rem;"></div>
      <BaseDialog :visible.sync="visibleMaintainItemSelect" :title="'保修旧件选择'" destroyOnClose width="850px" :containerStyle="{height: 'calc(100% - 60px)', overflow: 'auto'}">
        <MaintainItemSelectVehicle @close="closeMaintainItemSelect" @save="saveMaintainItemSelect" :whCode="whCode"></MaintainItemSelectVehicle>
      </BaseDialog>
      <BaseDialog :visible.sync="visibleSelectByClaim" :title="'保修旧件查看'" destroyOnClose width="850px" :containerStyle="{height: 'calc(100% - 60px)', overflow: 'auto'}">
        <selectByClaim @close="closeSelectByClaim" :rowData="rowData"></selectByClaim>
      </BaseDialog>

      <BasePrint ref="templateEncasement" :data="waitEncasementList" template="waitReturnLabel/encasement" />
    </div>
  </Spin>
</template>
<script>
import { getListByExample, getPartType, getListByExampleWhere, getByPermissionCtrl } from '@/api/dictionary/index.js';
import MaintainItemSelectVehicle from './MaintainItemSelectVehicle.vue';
import selectByClaim from './selectByClaim.vue';
import { IDNumber, zipCode, phone, email, testPW } from '@/utils/validate'
import { editSave, selectById } from '@/api/usedPartsReturnManage/usedPartsReturn_DLR/usedPartsReturn';
import { dictionary } from '@/utils/dictMixin';
import { getAppId } from '@/assets/js/auth';
import { selectByParaCode } from '@/api/claim/factory/SystemParameterMaintain';
import moment from "moment";

export default {
  props: ['rowData'],
  mixins: [dictionary],
  components: {
    MaintainItemSelectVehicle,
    selectByClaim
  },
  data() {
    return {
      loading: false,
      editData: {},
      dataList: [],
      dataList2: [],
      collapse: false,
      visibleSelectByClaim: false,
      infoId: null,
      columns: this.creatHeader(),
      columns2: this.creatHeader2(),
      fetchParams: {}, //ipa 接口
      selectedRows: [], //选中服务站
      formList: this.createFormList(),
      formList2: this.createFormList2(),
      saveData: null,
      claimIds: [],
      saveData2: null,
      whId: null,
      whName: null,
      visibleMaintainItemSelect: false,
      whCode: null,
      returnTimeStart: null,
      returnTimeEnd: null,
      showReport: true,
      appId: null,
      jfDisableButton: true,
      ownerCode: null,
      dealerName: null,
      month: null,
      waitEncasementList:{
        rows:[{

        }]
      }
    };
  },
  async created() {
    this.loading = true;
    await this.chuqi();
    await this.chuqi3();
    await this.init(this.rowData);
    await this.chuqi2();
    await this.getReturnTime();
    this.appId = await getAppId();
    this.loading = false;
  },
  methods: {
    async getReturnTime() {
      const res = await selectByParaCode({ paraCode: 'XTCS00032' });
      if (res.resultCode == 200) {
        if (getAppId() == 'beijing') {
          this.returnTimeStart = res.data.para1;
          this.returnTimeEnd = res.data.para2;
          if (getAppId() == 'beijing' && this.returnTimeStart && this.returnTimeEnd) {
            let day = moment().dates();
            if (!(res.data.para1 <= day && res.data.para2 >= day)) {
              this.showReport = false;
            }
          }
        }
      }
    },
    async init(val) {
      let newVar = await selectById({ id: val });
      this.editData = newVar.data;
      console.log("=== 通过ID查询结果返回 ==== ", newVar, " ======");
      this.month = newVar.data.month;
      this.ownerCode = newVar.data.ownerCode;
      this.dealerName = newVar.data.dealerName;
      if (newVar.data.returnType === 55951001) {
        this.jfDisableButton = false;
      }
      this.saveMaintainItemSelect(newVar.data.dtlList);
      this.formList.forEach(x => {
        console.log(newVar);
        x.initialValue = newVar.data[x.fieldName];
      });
      this.formList2.forEach(x => {
        x.initialValue = newVar.data[x.fieldName];
        if (x.fieldName == 'fileList') {
          x.initialValue = newVar.data.fileList.map((f) => ({ name: f.title, url: f.fileUrl }));
        }
      });
      // for(let i in newVar.data.dtlList){
      //   newVar.data.dtlList[i].partStatus=newVar.data.dtlList[i].partStatus==null?55221001:newVar.data.dtlList[i].partStatus;
      //   if(!newVar.data.dtlList[i].inCount){
      //     // newVar.data.dtlList[i].inCount =  newVar.data.dtlList[i].partCount
      //     newVar.data.dtlList[i].inCount =  newVar.data.dtlList[i].actualPartCount
      //   }
      // }
      // this.$refs.table1.$refs.pageTable.EXECUTE_INSERT(newVar.data.dtlList);
      this.$refs.table1.$refs.pageTable.EXECUTE_INSERT(newVar.data.claimList);
      this.$refs.table2.$refs.pageTable.EXECUTE_INSERT(newVar.data.logList);
    },
    //旧件仓库下拉框
    async chuqi() {
      console.log("===== 获取下拉框数据 ====== ")
      const res = await getByPermissionCtrl();
      console.log("==========", res)
      if (res.resultCode == 200 && res.data) {
        this.formList.find(x => x.fieldName == 'whCode').initialValue = '';
        this.formList.find(x => x.fieldName == 'whCode').itemList = res.data.map(y => ({ text: y.whName, value: y.whCode }));
      }
    },
    //运输方式下拉框
    async chuqi2() {
      console.log("===== 获取下拉框数据 ====== ")
      const res = await getPartType({ type: 5521 });
      console.log("==========", res)
      let arr = res.data;
      if (res.resultCode == 200) {
        if (!this.jfDisableButton) {
          res.data = res.data.filter(function (item) {
            return item.codeId !== 55211004
          });
        }
        this.formList2.find(x => x.fieldName == 'expressType').itemList = res.data.map(y => ({ text: y.codeCnDesc, value: y.codeId }));
      }
    },
    //装箱属性
    async chuqi3() {
      console.log("===== 获取下拉框数据 ====== ")
      const res = await getPartType({ type: 5591 });
      console.log("==========", res)
      if (res.resultCode == 200) {
        this.columns.find(x => x.dataIndex == 'boxAttrStr').initialValue = '';
        this.columns.find(x => x.dataIndex == 'boxAttrStr').editItems = res.data.map(y => ({ text: y.codeCnDesc, value: y.codeId }));
      }
    },
    formChangeHandle1(val) {
      console.log("formChangeHandle1", val);
      this.saveData = val;
    },
    formChangeHandle2(val) {
      console.log("formChangeHandle2", val);
      this.saveData2 = val;
    },
    //搜索获取数据
    changeHandle(val) {
      this.fetchParams = val;
      console.log(val);
    },
    closeSelectByClaim() {
      this.visibleSelectByClaim = false;
    },
    //选中
    selectChange(rows) {
      this.selectedRows = rows;
      console.log(this.selectedRows);
    },
    //取消操作
    closeDialog() {
      this.$emit('close');
    },
    maintainItemSelectTurnOn() {
      if (this.formList.find(x => x.fieldName == 'whCode').initialValue) {
        this.whCode = this.formList.find(x => x.fieldName == 'whCode').initialValue
        this.visibleMaintainItemSelect = true;
      } else {
        this.$notify.error({ title: '提示信息', message: '请选择旧件仓库!' });
      }
    },
    //子页面带回数据
    saveMaintainItemSelect(val) {
      this.visibleMaintainItemSelect = false;
      let list = [];
      let pageList = this.$refs.table1.$refs.pageTable.list;
      val.map(x => {
        this.claimIds.push(x.cmsClaimId)
        if (pageList.length == 0) {
          list.push(x);
        } else {
          if (!pageList.find(f => f.cmsClaimId == x.cmsClaimId)) {
            list.push(x);
          }
        }
      });
      // list.map(f =>{
      //   console.log(f.cmsClaimNo);
      // delete f.pestructionCount;
      // delete f.partCount;
      // })
      // this.$refs.table1.$refs.pageTable.EXECUTE_DELETE(this.$refs.table1.$refs.pageTable.list);
      console.log(list);
      this.$refs.table1.$refs.pageTable.EXECUTE_INSERT(list);
      this.fetchParams = { ...this.fetchParams };
      console.log("claimIds=>", this.claimIds)
    },
    closeMaintainItemSelect() {
      this.visibleMaintainItemSelect = false;
    },

    printBox() {
      this.waitEncasementList.rows = this.dataList;
      this.$nextTick(() => {
        this.$refs.templateEncasement.EXCUTE_PRINT();
      });
    },
    //保存
    async saveDialog() {

      this.formList.find(x => x.fieldName == 'expressAddress').rules[0].required = false;
      this.formList.find(x => x.fieldName == 'conPerson').rules[0].required = false;
      this.formList.find(x => x.fieldName == 'conTel').rules[0].required = false;
      this.formList2.find(x => x.fieldName == 'expressType').rules[0].required = false;
      this.formList2.find(x => x.fieldName == 'expressCompany').rules[0].required = false;
      // this.formList2.find(x => x.fieldName == 'expressNo').rules[0].required = false;
      this.formList2.find(x => x.fieldName == 'dlDate').rules[0].required = false;


      if (this.$refs.formPanel1.SUBMIT_FORM() != null) {

        this.$refs.formPanel2.SUBMIT_FORM();

        console.log("通知", this.saveData);
        console.log("上报", this.saveData2);
        console.log("保修", this.dataList);
        console.log("操作", this.dataList2);

        this.claimIds = [];

        this.$refs.table1.$refs.pageTable.list.map(x => {
          this.claimIds.push(x.claimId);
        });
        let ids = '';
        this.claimIds.map(x => {
          ids += x + ','
        });
        this.claimIds = ids;

        console.log("保修旧件ID集合", this.claimIds);

        if (this.saveData !== null) {

          this.saveData.whId = this.whId;
          this.saveData.whName = this.whName;

          //单据状态 旧件回运草稿字典码
          this.saveData.returnStatus = 55881001;

          let save = {};
          save = Object.assign({}, this.saveData, this.saveData2);
          let fileList = [];

          this.saveData2.fileList.map((x) => {
            fileList.push({ title: x.name, fileUrl: x.url });
          });

          save.email = this.saveData.email;
          save.fileList = fileList;
          save.dtlList = this.dataList;
          save.claimIds = this.claimIds;

          for (let a in this.editData) {
            if (save[a]) {
              this.editData[a] = save[a];
            }
          }
          this.loading = true;
          let res = await editSave(this.editData);

          console.log(res);
          if (res.resultCode === 200) {
            this.$emit('save');
            return this.$notify.success({ title: '提示信息', message: '保存成功' });
          } else {
            this.loading = false;
            this.$notify.error({ title: '提示信息', message: res.errMsg || '保存失败!' });
            // this.closeDialog();
          }
          this.loading = false;
        }
      }
    },
    //上报
    async saveDialog2() {
      console.log("上报claimIds=>", this.claimIds);

      this.formList.find(x => x.fieldName == 'expressAddress').rules[0].required = true;
      this.formList.find(x => x.fieldName == 'conPerson').rules[0].required = true;
      this.formList.find(x => x.fieldName == 'conTel').rules[0].required = true;
      this.formList2.find(x => x.fieldName == 'expressType').rules[0].required = true;
      this.formList2.find(x => x.fieldName == 'expressCompany').rules[0].required = true;
      // this.formList2.find(x => x.fieldName == 'expressNo').rules[0].required = true;
      this.formList2.find(x => x.fieldName == 'dlDate').rules[0].required = true;


      if (this.$refs.formPanel1.SUBMIT_FORM() != null) {
        this.$refs.formPanel2.SUBMIT_FORM();

        console.log("通知", this.saveData);
        console.log("上报", this.saveData2);
        console.log("保修", this.dataList);
        console.log("操作", this.dataList2);

        if (this.$refs.table1.$refs.pageTable.list.length > 0) {
          this.claimIds = [];
          this.$refs.table1.$refs.pageTable.list.map(x => {
            console.log("上报遍历x=>", x);
            if (x.claimId === undefined) {
              this.claimIds.push(x.cmsClaimId);
            } else {
              this.claimIds.push(x.claimId);
            }
          });
          console.log("上报遍历x后=>", this.claimIds);
          let ids = '';
          this.claimIds.map(x => {
            ids += x + ','
          });
          this.claimIds = ids;

          console.log("保修旧件ID集合", this.claimIds);

          if (this.saveData !== null) {

            this.saveData.whId = this.whId;
            this.saveData.whName = this.whName;

            //单据状态 旧件回运草稿字典码
            this.saveData.returnStatus = 55881002;

            let save = {};
            save = Object.assign({}, this.saveData, this.saveData2);
            let fileList = [];

            this.saveData2.fileList.map((x) => {
              fileList.push({ title: x.name, fileUrl: x.url });
            });

            save.fileList = fileList;
            save.dtlList = this.dataList;
            for (let i = 0; i < save.dtlList.length; i++) {
              if (save.dtlList[i]) {
                if (!save.dtlList[i].actualPartCount || save.dtlList[i].actualPartCount > save.dtlList[i].partCount) {
                  console.log(save.dtlList[i])
                  this.$notify({
                    title: '警告',
                    message: '请输入正确的回运数量!',
                    type: 'warning',
                  });
                  this.loading = false;
                  return;
                }
                if (!save.dtlList[i].boxNo) {
                  this.$notify({
                    title: '警告',
                    message: '请输入箱号!',
                    type: 'warning',
                  });
                  this.loading = false;
                  return;
                }
                if (!save.dtlList[i].boxAttrStr) {
                  this.$notify({
                    title: '警告',
                    message: '请选择装箱方式!',
                    type: 'warning',
                  });
                  this.loading = false;
                  return;
                }
              }
            }

            save.claimIds = this.claimIds;

            for (let a in this.editData) {
              if (save[a]) {
                this.editData[a] = save[a];
              }
            }
            this.loading = true;
            let res = await editSave(this.editData);

            console.log(res);
            if (res.resultCode === 200) {
              this.$emit('save');
              return this.$notify.success({ title: '提示信息', message: '上报成功' });
            } else {
              this.loading = false;
              this.$notify.error({ title: '提示信息', message: res.errMsg || '上报失败!' });
              // this.closeDialog();
            }
            this.loading = false;
          }
        } else {
          this.$notify.error({ title: '提示信息', message: '请添加旧件列表!' });
        }
      }

    },
    async changeSeriesSelect(val) {
      console.log("传参", val)
      const res = await getListByExampleWhere({ whCode: val });
      res.data.find(x => {
        if (x.whCode === val) {
          this.whId = x.whId;
          this.whName = x.whName;
          this.formList.find(x => x.fieldName == 'expressAddress').initialValue = x.whAddress;
          this.formList.find(x => x.fieldName == 'conPerson').initialValue = x.cPerson;
          this.formList.find(x => x.fieldName == 'conTel').initialValue = x.cTel;
          this.formList.find(x => x.fieldName == 'email').initialValue = x.eMail;
          console.log(res.data)
        }
      })
      this.$refs.table1.$refs.pageTable.EXECUTE_DELETE(this.$refs.table1.$refs.pageTable.list);
      console.log(this.whId);
    },
    //保修旧件列表
    deleteHandle(row) {
      this.$refs.table1.$refs.pageTable.EXECUTE_DELETE([row]);
    },
    queryByNo(val) {
      console.log('查看明细', val);
      this.rowData = val.cmsClaimId;
      console.log('查看明细', this.rowData);
      this.visibleSelectByClaim = true;
    },
    //通知单信息
    //通知单信息
    createFormList() {
      return [
        {
          type: 'INPUT',
          label: '通知单号',
          fieldName: 'returnNo',
          readonly: true,// 只读
          disabled: true // 置会
        },
        {
          type: 'INPUT',
          label: '联系人',
          placeholder: '请输入联系人...',
          rules: [{ required: true, message: '请输入联系人....', trigger: 'change' }],
          fieldName: 'conPerson'
        },
        {
          type: 'INPUT',
          label: '联系电话',
          placeholder: '请输入联系电话...',
          rules: [{ required: true, message: '请输入联系电话...', validator: phone, trigger: 'blur' }],
          fieldName: 'conTel'
        },
        {
          type: 'SELECT',
          label: '旧件仓库',
          fieldName: 'whCode',
          placeholder: '请选择旧件仓库...',
          rules: [{ required: true, message: '请选择旧件仓库...', trigger: 'change' }],
          itemList: [],
          change: val => {
            this.changeSeriesSelect(val);
          },
        },
        {
          type: 'INPUT',
          label: '邮寄地址',
          placeholder: '请输入邮寄地址...',
          rules: [{ required: true, message: '请输入邮寄地址...', trigger: 'change' }],
          fieldName: 'expressAddress'
        },
        // {
        //   type: 'INPUT',
        //   label: '邮箱',
        //   placeholder: '请输入邮箱...',
        //   rules: [{ trigger: 'blur', validator: email }],
        //   fieldName: 'email'
        // },
      ];
    },
    //上报信息
    createFormList2() {
      return [
        {
          type: 'SELECT',
          label: '运输方式',
          fieldName: 'expressType',
          rules: [{ required: true, message: '请选择运输方式...', trigger: 'change' }],
          placeholder: '请选择运输方式...',
          itemList: []
        },
        {
          type: 'INPUT',
          label: '物流公司',
          placeholder: '请输入物流公司...',
          rules: [{ required: true, message: '请输入物流公司...', trigger: 'change' }],
          fieldName: 'expressCompany'
        },
        {
          type: 'INPUT',
          label: '物流单号',
          placeholder: '请输入物流单号...',
          // rules: [{required: true, message: '请输入物流单号...', trigger: 'change'}],
          fieldName: 'expressNo'
        },
        {
          type: 'INPUT_NUMBER',
          label: '包装箱数',
          placeholder: '请输入包装箱数...',
          fieldName: 'boxCounts'
        },
        {
          type: 'INPUT_NUMBER',
          label: '纸箱数量',
          placeholder: '请输入纸箱数量...',
          fieldName: 'paperCounts'
        },
        {
          type: 'INPUT_NUMBER',
          label: '木箱数量',
          placeholder: '请输入木箱数量...',
          fieldName: 'woodCounts'
        },
        {
          type: 'INPUT_NUMBER',
          label: '铁箱数量',
          placeholder: '请输入铁箱数量...',
          fieldName: 'ironCounts'
        },
        {
          type: 'INPUT_NUMBER',
          label: '裸件数量',
          placeholder: '请输入裸件数量...',
          fieldName: 'bareParts'
        },
        {
          type: 'DATE',
          label: '发运时间',
          fieldName: 'dlDate',
          valueFormat: 'yyyy-MM-dd', //返回数据格式
          initialValue: '',
          placeholder: '请选择发运时间...',
          style: { width: '100%' },
          rules: [{ required: true, message: '请选择发运时间...', trigger: 'change' }]
        },
        {
          type: 'INPUT_NUMBER',
          label: '旧件回运费用',
          placeholder: '请输入旧件回运费用...',
          fieldName: 'freightAmount'
        },
        {
          type: 'TEXT_AREA',
          label: '备注',
          fieldName: 'remarks',
          placeholder: '请输入备注...',
          selfCols: 3,// 元素占据几行
          rows: 3
        },
        {
          type: 'UPLOAD_FILE',
          label: '选择文件',
          fieldName: 'fileList',
          placeholder: '选择文件...',
          initialValue: [],
          upload: {
            actionUrl: 'https://dcs-test-api.livanauto.com/api/file/oss/upload',
            fileTypes: ['pdf', 'jpg', 'png', 'rar'],
            limit: 10,
            max: 1024 * 100,
            tipText: '（支持PDF、RAR、JPG格式）'
          }
        }
      ];
    },
    //保修旧件列表
    creatHeader() {
      return [
        {
          title: '序号',
          dataIndex: 'index',
          width: 80,
          sorter: true,
          render: props => {
            return <span>{props.row.index + 1}</span>;
          }
        },
        {
          title: '操作',
          dataIndex: 'column-action',
          width: 100,
          render: (props) => {
            if (props.row.returnType !== 55951002) {
              return (
                <div style="text-align:center">
                  <multiuse-button size="mini" type="text" onClick={() => this.queryByNo(props.row)}>
                    查看
                  </multiuse-button>
                  <el-divider direction="vertical" />
                  <multiuse-button size="mini" type="text" onClick={() => this.deleteHandle(props.row)}>
                    删除
                  </multiuse-button>
                </div>
              );
            } else {
              return (
                <div style="text-align:center">
                  <multiuse-button size="mini" type="text" onClick={() => this.queryByNo(props.row)}>
                    查看
                  </multiuse-button>
                </div>
              );
            }
          },
        },
        { title: '索赔id', dataIndex: 'cmsClaimId', sorter: true, hidden: true },
        // { title: '车辆属性', dataIndex: 'ifComm', sorter: true,filterItems: this.createDictList('5543'),
        //   dictItems: this.createDictList('5543'),
        //   render: props => {
        //     return <span>{this.createDictText(props.row.ifComm, '5543')}</span>;
        //   } },
        { title: '索赔单号', dataIndex: 'cmsClaimNo', sorter: true },
        { title: 'VIN', dataIndex: 'vin', sorter: true, width: 150 },
        { title: '索赔类型', dataIndex: 'cmsClaimTypeStr', sorter: true },
        // {title: '维修单号', dataIndex: 'roNo', sorter: true},
        { title: '旧件id', dataIndex: 'partId', sorter: true, hidden: true },
        { title: '旧件代码', dataIndex: 'partCode', sorter: true },
        { title: '旧件名称', dataIndex: 'partName', sorter: true },
        { title: '供应商编码', dataIndex: 'supCode', sorter: true },
        // {title: '主损件代码', dataIndex: 'mainPartCode', sorter: true},
        // {title: '主损件名称', dataIndex: 'mainPartName', sorter: true},
        {
          title: '旧件数量',
          dataIndex: 'partCount',
          // minWidth: 90,
          sorter: true,
          // editable: true,
          // defaultEditable: true,
          // showOverflowTooltip: true,
          // editType: 'input'
          width: 100
        },
        {
          title: '回运数量',
          dataIndex: 'actualPartCount',
          render: (props) => {
            return (
              <div style="text-align:center">
                <el-input
                  οnkeyup="value=value.replace(/[^\d]/g,'')"
                  // disabled="true"
                  v-model={props.row.actualPartCount}
                />
              </div>
            );
          },
        },
        {
          title: '装箱属性',
          dataIndex: 'boxAttrStr',
          sorter: true,
          minWidth: 120,
          editable: true,
          defaultEditable: true,
          showOverflowTooltip: true,
          editType: 'select',
          editItems: []
        },
        {
          title: '箱号',
          dataIndex: 'boxNo',
          render: (props) => {
            return (
              <div style="text-align:center">
                <el-input
                  // disabled="true"
                  v-model={props.row.boxNo}
                />
              </div>
            );
          },
        }
        // {title: '索赔类型', dataIndex: 'cmsClaimType', sorter: true, hidden: true},
      ];
    },
    //操作记录
    creatHeader2() {
      return [
        { title: '操作人', dataIndex: 'checkByStr', sorter: true },
        { title: '操作时间', dataIndex: 'checkAt', sorter: true },
        // {title: '操作类型', dataIndex: 'checkStatus2', sorter: true},
        { title: '操作后状态', dataIndex: 'statusStr', sorter: true },
        // {title: '操作备注', dataIndex: 'checkRemarks', sorter: true}
      ];
    }
  }
};
</script>

<style lang="less" scoped></style>
